package javacore.v1ch3;

public class SimpleType {

    float PI = 3.14f;
    static float PI_2 = 2.1415f;

    void test() {
        PI_2 = 123f;
    }

    public static void main(String[] args) {
        // args参数
        for (var s : args
        ) {
            System.out.println(s);

        }

        // 整型变量
        int int_value = Integer.valueOf("100");
        int int_value2 = 1_000_000;
        short short_value = Short.MAX_VALUE;
        long long_value = Long.valueOf("100");
        byte byte_value = 90;

        System.out.println(int_value2);

        // 变量与类常量
//        PI = 3.14f;
        PI_2 = 111f;

        // 枚举
        enum Size {SMALL, MIDDLE, LARGE}
        ;

        System.out.println("enum.SMALL == " + Size.SMALL);

        // 类型转换
        double x = 9.997;
        int nx = (int) x;
        System.out.println(nx);

        // string
        var string_a = new String("hello");
        var string_b = "hello";
        System.out.println("string_a == string_b," + (string_a == string_b));
    }
}
